package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.CleaningOrderMapper;
import com.ruoyi.system.domain.CleaningOrder;
import com.ruoyi.system.service.ICleaningOrderService;

/**
 * 清洁服务订单Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-06-16
 */
@Service
public class CleaningOrderServiceImpl implements ICleaningOrderService 
{
    @Autowired
    private CleaningOrderMapper cleaningOrderMapper;

    /**
     * 查询清洁服务订单
     * 
     * @param coId 清洁服务订单ID
     * @return 清洁服务订单
     */
    @Override
    public CleaningOrder selectCleaningOrderById(Long coId)
    {
        return cleaningOrderMapper.selectCleaningOrderById(coId);
    }

    /**
     * 查询清洁服务订单列表
     * 
     * @param cleaningOrder 清洁服务订单
     * @return 清洁服务订单
     */
    @Override
    public List<CleaningOrder> selectCleaningOrderList(CleaningOrder cleaningOrder)
    {
        return cleaningOrderMapper.selectCleaningOrderList(cleaningOrder);
    }

    /**
     * 新增清洁服务订单
     * 
     * @param cleaningOrder 清洁服务订单
     * @return 结果
     */
    @Override
    public int insertCleaningOrder(CleaningOrder cleaningOrder)
    {   cleaningOrder.setCoCreattime(DateUtils.getNowDate());
        return cleaningOrderMapper.insertCleaningOrder(cleaningOrder);
    }

    /**
     * 修改清洁服务订单
     * 
     * @param cleaningOrder 清洁服务订单
     * @return 结果
     */
    @Override
    public int updateCleaningOrder(CleaningOrder cleaningOrder)
    {
        return cleaningOrderMapper.updateCleaningOrder(cleaningOrder);
    }

    /**
     * 批量删除清洁服务订单
     * 
     * @param coIds 需要删除的清洁服务订单ID
     * @return 结果
     */
    @Override
    public int deleteCleaningOrderByIds(Long[] coIds)
    {
        return cleaningOrderMapper.deleteCleaningOrderByIds(coIds);
    }

    /**
     * 删除清洁服务订单信息
     * 
     * @param coId 清洁服务订单ID
     * @return 结果
     */
    @Override
    public int deleteCleaningOrderById(Long coId)
    {
        return cleaningOrderMapper.deleteCleaningOrderById(coId);
    }
}
